import request from '@/utils/request'

// 工单状态列表
export const getAllTaskStatusApi = () => request.get('/task-service/task/allTaskStatus')

// 工单搜索
export const searchTaskApi = params => request.get('/task-service/task/search',{
  params
})

// 获取工单类型
export const getTaskTypeApi = () => request.get('/task-service/taskType/list')

// 根据售货机获取运营人员列表
export const getOperatorListApi = code => request.get(`/user-service/user/operatorList/${code}`)

// 根据售货机获取运维人员列表
export const getOperatorPersonApi = code => request.get(`/user-service/user/repairerList/${code}`)

// 根据售货机获取补货详情 内层弹窗
export const getGoodsImportListApi = code => request.get(`/vm-service/channel/channelList/${code}`)

// 创建工单
export const createTaskApi = data => request.post('/task-service/task/create', data)

// 获取补货预警值
export const getsupplyAlertApi = () => request.get('/task-service/task/supplyAlertValue')

// 设置补货预警值
export const setsupplyAlertApi = data => request.post('/task-service/task/autoSupplyConfig', data)

// 获取工单详情
export const getTaskInfoApi = id => request.get(`/task-service/task/taskInfo/${id}`)

// 取消工单
export const cancelTaskApi = data => request.post(`/task-service/task/cancel/${data.taskId}`, data)

// 获取补货详情
export const getSupplyInfoApi = id => request.get(`/task-service/taskDetails/${id}`)
